package com.my.study.redisson.register.node;

import lombok.ToString;

/**
 * 节点
 *
 * @author: yidujun
 * @create: 2021/11/23 15:00
 */
@ToString
public class RedisRegisterNode implements RegisterNode {
    private String ip;
    private String port;
    private int serverNo;
    private long expirePeriod;

    public RedisRegisterNode(String ip, String port) {
        this.ip = ip;
        this.port = port;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public int getServerNo() {
        return serverNo;
    }

    public void setServerNo(int serverNo) {
        this.serverNo = serverNo;
    }

    public long getExpirePeriod() {
        return expirePeriod;
    }

    public void setExpirePeriod(long expirePeriod) {
        this.expirePeriod = expirePeriod;
    }

    @Override
    public String getName() {
        return this.ip + ":" + this.port;
    }
}
